#include <gnome.h>

#define MK_TYPE(x) {#x,x}
struct {
	gchar *type_name;
	GtkShadowType type;
}types[] = {
	MK_TYPE(GTK_SHADOW_NONE),MK_TYPE(GTK_SHADOW_IN),
	MK_TYPE(GTK_SHADOW_OUT),MK_TYPE(GTK_SHADOW_ETCHED_IN),
	MK_TYPE(GTK_SHADOW_ETCHED_OUT)
};

GtkWidget *make_frames(void){
	GtkWidget *vbox,*hbox;
	GtkWidget *frame;
	GtkWidget *label;

	hbox = gtk_hbox_new(FALSE,10);

	vbox = gtk_vbox_new(FALSE,10);
	for(int i = 0;i < 5;i++){
		frame = gtk_frame_new(types[i].type_name);
		gtk_frame_set_shadow_type(GTK_FRAME(frame),types[i].type);
		gtk_container_add(GTK_CONTAINER(vbox),frame);
		label = gtk_label_new(types[i].type_name);
		gtk_container_add(GTK_CONTAINER(frame),label);
		if(i == 3){
			gtk_frame_set_label_align(GTK_FRAME(frame),1.0,1.0);
		}
	}
	gtk_container_add(GTK_CONTAINER(hbox),vbox);
	vbox = gtk_vbox_new(FALSE,10);
	frame = gtk_aspect_frame_new("Hello Panda",0.5,0.5,3,TRUE);
	gtk_container_set_border_width(GTK_CONTAINER(frame),10);
	GtkWidget *btn = gtk_button_new_with_label("click panda\nclick hopy");
	gtk_container_set_border_width(GTK_CONTAINER(btn),10);
	gtk_container_add(GTK_CONTAINER(frame),btn);
	gtk_container_add(GTK_CONTAINER(vbox),frame);
	gtk_container_add(GTK_CONTAINER(hbox),vbox);

	return hbox;
}

int main(int argc,char **argv){
	GtkWidget *w,*frames;

	gnome_init("","",argc,argv);
	w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_container_set_border_width(GTK_CONTAINER(w),25);
	gtk_signal_connect(GTK_OBJECT(w),"destroy",G_CALLBACK(gtk_main_quit),NULL);
	frames = make_frames();
	gtk_container_add(GTK_CONTAINER(w),frames);
	gtk_widget_show_all(w);
	gtk_main();

	return 0;
}